package pw.yumc.Residence.runnable;

import java.util.ArrayList;
import java.util.List;

import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitTask;

public class TaskManager {
    Plugin plugin;

    List<BukkitTask> tasklist;

    public TaskManager(Plugin plugin) {
        this.plugin = plugin;
        this.tasklist = new ArrayList<BukkitTask>();
    }

    public void add(BukkitTask task) {
        tasklist.add(task);
    }

    public void cancelall() {
        for (BukkitTask bukkitTask : tasklist)
            bukkitTask.cancel();
    }
}
